package de.dfki.mary;

import marytts.LocalMaryInterface;

import javax.sound.sampled.AudioFileFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import java.io.File;

public class Test {

    public static void main(String[] args) throws Exception {
        LocalMaryInterface maryInterface = new LocalMaryInterface();
        /**
         *  Set the input type for processing to the new input type.
         */
//        maryInterface.setInputType();
        /**
         *  Set the output type for processing to the new output type.
         */
//        maryInterface.setOutputType();
        /**
         *  Set the locale for processing. Set the voice to the default voice for this locale.
         */
//        maryInterface.setLocale();
        /**
         *  Set the voice to be used for processing. If the current locale differs from the voice's locale, the locale is updated accordingly.
         */
//        maryInterface.setVoice();
        /**
         *  Set the audio effects. For advanced use only.
         */
//        maryInterface.setAudioEffects("F0Scale(durScale(*,1.5),1.0)");
        /**
         *  Set the speaking style. For advanced use only.
         */
//        maryInterface.setStyle();
        /**
         *  Set the output type parameters. For advanced use only.
         */
//        maryInterface.setOutputTypeParams();
        /**
         *  Set whether to stream audio. For advanced use only.
         */
//        maryInterface.setStreamingAudio();

        String text = "Hello，Welecome to use MaryTTS！";
        AudioInputStream audio = maryInterface.generateAudio(text);
        AudioSystem.write(audio, AudioFileFormat.Type.WAVE, new File("output.wav"));
    }

}
